package com.mirana.frame.base.model;

import com.mirana.frame.constants.SysConstants;
import com.mirana.frame.db.base.anno.ColumnPlus;
import com.mirana.frame.db.base.anno.IDPlus;
import com.mirana.frame.db.base.anno.Notes;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public abstract class BaseModel implements Serializable {

    @Notes("自增主键ID")
    @IDPlus(name = SysConstants.DB_PRIMARY_KEY)
    @ColumnPlus
    protected Long id;

    @Notes("是否启用，默认1。0：未启用，1：已启用。")
    @ColumnPlus(default_val = "1", length = "1")
    private int enable_flag;

    @Notes("是否删除，默认0。0：未删除，1：已删除。")
    @ColumnPlus(default_val = "0", length = "1")
    private int delete_flag;

    @Notes("创建人")
    @ColumnPlus(default_val = "''", name = "created_by", length = "20")
    private String createdBy;

    @Notes("创建时间")
    @ColumnPlus(name = "created_time")
    private Date createdTime;

    @Notes("更新人")
    @ColumnPlus(default_val = "''", name = "updated_by", length = "20")
    private String updatedBy;

    @Notes("更新时间")
    @ColumnPlus(name = "updated_time")
    private Date updatedTime;
}

